#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#include "treeMgt.h"
int main( int argc, char *argv[] )
{
  TreeNode * tnRoot;
  TreeNode * r    = newTreeNode( "Root" );
  fprintf(stderr,"Node created");
  Tree * t = newTree(r);
  TreeNode * tnP1 = newTreeNode( "P1" );
  TreeNode * tnP2 = newTreeNode( "P2" );
  TreeNode * tnP3 = newTreeNode( "C1" );
  TreeNode * tnP4 = newTreeNode( "C2" );

  TreeNode * tnC1 = newTreeNode( "C-P1" );
  TreeNode * tnC2 = newTreeNode( "C-C2" );

  fprintf( stderr, "nodes created\n" );

  addChildToParentNode(r, tnP1);
  addChildToParentNode(r, tnP2);
  addChildToParentNode(r, tnP3);
  addChildToParentNode(r, tnP4);

  addChildToParentNode(tnP1, tnC1);
  addChildToParentNode(tnP4, tnC2);


  fprintf( stderr, "4th child added\n" );

  tnRoot = getNodeFromRoot(t);
  assert(tnRoot == r);
  fprintf(stderr,  "DFS traversal :\n");
  dfsTraversalOn( tnRoot );
  fprintf(stderr, "\n");
}
